package org.hive.testserver.domain.util;

import java.util.Calendar;
import java.util.GregorianCalendar;


/**
 * Clock that will always respond with the same date and time. Useful for test cases.
 */
public class BrokenClock extends Clock {

	private long timeInMillis;

	public static BrokenClock clock20010203_1630() {
		GregorianCalendar calendar = new GregorianCalendar(2001, Calendar.FEBRUARY, 3, 16, 30);
		return new BrokenClock(calendar.getTimeInMillis());
	}
	
	public BrokenClock(long timeInMillis) {
		super();
		this.timeInMillis = timeInMillis;
	}
	
	@Override
	public long currentTimeMillis() {
		return timeInMillis;
	}

	public void setTimeInMillis(long timeInMillis) {
		this.timeInMillis = timeInMillis;
	}
}
